package com.atlin.project.utils.file;

import com.atlin.project.config.AtLinConfig;
import com.atlin.project.model.enums.FileUploadBizEnum;

/**
 * @author atlin
 * @description 文件上传通用工具
 * @createDate 2024/9/12 20:41
 */
public class FileUtils {

    /**
     * 根据上传文件类型动态获取文件存储路径
     *
     * @param fileUploadBizEnum 文件类型枚举
     * @return 文件路径
     */
    public static String getUploadPath(FileUploadBizEnum fileUploadBizEnum) {
        switch (fileUploadBizEnum) {
            case USER_AVATAR:
                return AtLinConfig.getAvatarPath();
            case USER_IMPORT:
                return AtLinConfig.getImportPath();
            default:
                return AtLinConfig.getUploadPath();
        }
    }
}
